<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body,html {
	margin: 0 auto;
	height: 100%;
	width: 100%;
	overflow: hidden;
}
</style>
</head>
<body>
	<div id="logLogin_mainDiv" style="width: 100%; height: 100%;" class="divfrist">
		<div style="width: 100%; height: 0.7%; overflow: hidden;"></div>
		<div style="width: 100%; height: 98.6%;">
			<div style="width: 0.4%; height: 100%; float: left; overflow: hidden;"></div>
			<div style="width: 99.2%; height: 100%; float: left;">
				<div class="allborder" style="overflow: auto; height: 100%; max-height: 100%;">
					<!--内容区 -->
					<div style="width: 100%; height: 100%;">
						<table id="logLoginTable" border="false"></table>
					</div>
					<div id="logLogin_tb" style="overflow: hidden; padding-left: 10px; padding-top: 5px;padding-bottom: 5px;">
						工号或姓名:<input type="text" name="userName" id="userName">开始时间:<input id="startTime" type="text"></input>结束时间:<input id="endTime" type="text"></input> <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="window.logLogin.loadGridData()">查询</a>||
					</div>
					<!--内容区 -->
				</div>
			</div>
			<div class="width:0.37%;height:100%;float:left;overflow:hidden;"></div>
		</div>
		<div class="width:100%;height:0.6%;overflow:hidden;"></div>
	</div>
</body>
<script type="text/javascript">
	(function() {
		//创建角色table
		function createlogLoginTable() {

			$('#logLoginTable')
					.datagrid(
							{
								hidden:true,
								fit : true,
								toolbar : "#logLogin_tb",
								singleSelect : false,
								rownumbers : true,
								animate : true,
								queryParams : {
									userName : $("#userName").val(),
									startTime : $("#startTime").val(),
									endTime : $("#endTime").val()
								},
								url : '${pageContext.request.contextPath}/sys/sysUserAction!getUserLogLogin.action',
								striped : true,
								loadMsg : '正在加载数据',
								collapsible : true,
								idField : 'userLogId',
								fitColumns : true,
								columns : [ [ {
									field : 'userLogId',
									checkbox : true,
									width : 50
								}, {
									field : 'userWeb',
									title : '浏览器',
									width : 120
								}, {
									field : 'sysUserName',
									title : '用户名',
									width : 120
								}, {
									field : 'userIp',
									title : 'IP',
									width : 120
								}, {
									field : 'userLoginDate',
									title : '登陆时间',
									width : 120
								}, {
									field : 'userLogOutDate',
									title : '退出时间',
									width : 120
								} ] ],
								pagination : true
							});
		}
		//控件形成
		function createDate() {
			$('#userName').validatebox({
				required : true,
				validType : [ "unnormal", "length[0,15]" ]
			});
			$('#startTime').datebox({
				required : true,
				current : new Date()
			});
			var dd = new Date();
			m = dd.getMonth() + 1;
			var tempM="";
			if (m<10) {
				tempM= "0" + m;
			}else{
				tempM=m;
			}
			var valued = (dd.getYear() + 1900) + "-" + tempM + "-" + dd.getDate();
			$("#startTime").datebox("setValue", valued);
			$('#endTime').datebox({
				required : true,
				current : new Date()
			});
			$("#endTime").datebox("setValue", valued);
		}
		//点击查询
		function loadGridData() {
			$('#logLoginTable').datagrid('reload', {
				userName : $("#userName").val(),
				startTime : $("#startTime").datebox("getValue"),
				endTime : $("#endTime").datebox("getValue")
			});
		}
		//注册所有事件
		window["logLogin"] = {};
		window["logLogin"]["loadGridData"] = loadGridData;
		$(function() {
			$.parser.parse('#logLogin_mainDiv');
			createDate();
			createlogLoginTable();
		});
	})();
</script>
</html>